#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#include <algorithm>
#include <cstdio>
#include <iostream>

#define N 400020
#define M 25
using namespace std;

int a[N], b[N];

int main(void) {
  int n;
  int i, k, l, r, o;

  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);

  for (k = o = 0; k < M; k++) {
    for (i = 0; i < n; i++) b[i] = a[i] & ((1 << (k + 1)) - 1);

    // for(i=0;i<n;i++)cout<<b[i]<<' ';cout<<endl;

    sort(b, b + n);
    for (i = 0; i < n; i++) {
      l = max(0, (1 << k) - b[i]);
      r = ((1 << (k + 1)) - 1) - b[i];
      if ((upper_bound(b, b + i, r) - lower_bound(b, b + i, l)) & 1)
        o ^= 1 << k;

      l = max(0, (1 << k) + (1 << (k + 1)) - b[i]);
      r = ((1 << (k + 2)) - 1) - b[i];
      if ((upper_bound(b, b + i, r) - lower_bound(b, b + i, l)) & 1)
        o ^= 1 << k;
    }
  }
  printf("%d\n", o);

  return 0;
}
